// 导入fs模块
const fs = require('fs');
//1.异步读取
fs.readFile('./fs-writeFile/img/mds.jpg', (err, data) => {
    if (err) {
        console.log('读取失败！');
        return 0;
    }
    console.log('\n异步读取(内容如下):\n' + data.toString());
});
// 2.同步读取
let data = fs.readFileSync('./fs-writeFile/img/mds.jpg');
console.log('同步读取\n' + data.toString())